/*
 * @Date: 2024-06-26 10:17:03
 * @LastEditors: 陈俊宇 467724386@qq.com
 * @LastEditTime: 2024-11-06 16:07:00
 */
import request from '@/utils/request'

//获取产品分类
export function ticketProductCategory() {
    return request({
        url: `witek-ticket/app/ticket/getTicketProductCategory`,
        method: 'get',
    })
}

//获取产品列表
export function ticketProduct(id) {
    return request({
        url: `witek-ticket/app/ticket/getTpcProductList?categoryId=${id}`,
        method: 'get',
    })
}

// 查询产品型号列表
export function modelList(model) {
    return request({
        url: `/witek-ticket/app/ticket/getTpcProductModelList?model=${model}`,
        method: 'get',
    })
}

//获取工单类型
export function ticketType() {
    return request({
        url: `witek-ticket/app/ticket/getTicketType`,
        method: 'get',
    })
}

//提交工单表单
export function submitTicketForm(data) {
    return request({
        url: `/witek-ticket/app/ticket/apply`,
        method: 'post',
        data,
    })
}

//获取前置信息
export function Info(appId) {
    return request({
        url: `witek-contact/im/point/${appId}?title=1111&source=webim`,
        method: 'get',
    })
}

//获取端口号
export function port(data) {
    return request({
        url: `witek-contact/im/chatWindow`,
        method: 'post',
        data,
    })
}

//获取是否提交过咨询表单
export function consultForm(userId) {
    return request({
        url: `witek-contact/im/getConsultFormByToday?userId=${userId}`,
        method: 'get',
    })
}

//提交咨询表单
export function submitForm(data) {
    return request({
        url: `witek-contact/im/consultFormSave`,
        method: 'post',
        data,
    })
}

//获取国家列表
export function countryList(data) {
    return request({
        url: '/system/app/country/list',
        method: 'post',
        data,
    })
}

//提交咨询表单
export function submitConsultForm(data) {
    return request({
        url: 'witek-contact/im/consultFormSave',
        method: 'post',
        data,
    })
}

//提交满意度
export function submitEvaluate(data) {
    return request({
        url: 'witek-contact/im/satis',
        method: 'post',
        data,
    })
}

//发送/上传文件
export function upload(data) {
    return request({
        url: `/witek-contact/im/image/upload`,
        method: 'post',
        data,
    })
}

//获取智能回复一级分类类别
export function firstCategory() {
    return request({
        url: `/witek-contact/im/getFirstCategory`,
        method: 'get',
    })
}

//获取智能回复列表
export function replyList(data) {
    return request({
        url: `/witek-contact/im/getWikiReplyList`,
        method: 'post',
        data,
    })
}

//添加智能回复命中次数
export function addReplyHit(id) {
    return request({
        url: `/witek-contact/im/addReplyHit?id=${id}`,
        method: 'get',
    })
}
